<template>
    <div class="newinfo_content">
        <h1 class="h1">标题</h1>
        <p class="p1">
            <span>发表时间：2015-2-1 11:11:11</span>
            <span>点击次数</span>
        </p>
        <div class="content">内容</div>
        <!-- 如果获取到数据 -->
        <!-- <h1 class="h1">{{ list.title}}</h1>
        <p class="p1">
            <span>{{list.add_time | datastr}}</span>
            <span>点击次数：{{list.click}}</span>
        </p>
        <div class="content" v-html="list.content"></div> -->
        <!-- 评论制作 -->
        <subcontent :id="this.id"></subcontent>
    </div>
</template>
<script>
 import {Toast} from 'Mint-ui'
 import subcontent from '../subcontent/subcontent.vue'
export default {
   
    data() {
        return {
            id: this.$route.params.id,
            list: {}
        }
    },
    created() {
        this.show()
    }
    ,
    methods: {
        show() {
            this.$http.get('api/getnew/'+ this.id).then(function(res){
                if (res.body.status == 0) {
                    this.list = res.body.message
                }else {
                    Toast('请求失败')
                }
            },function() {
                 Toast('数据请求失败')
            }) 
        }
    },
    components: {
        subcontent
    }
    
}
</script>
<style lang="scss" scoped>
    .newinfo_content {
        padding: 0 4px;
        .h1 {
            font-size: 16px;
            color: red;
            margin: 8px 0;
            text-align: center;
        }
        .p1 {
            padding-bottom: 8px;
            color: aqua;
            display: flex;
            justify-content: space-between;
            border-bottom: 2px solid #ccc;
        }
    }
</style>